class Solution(object):
    def rotate(self, nums, k):
        """
        :type nums: List[int]
        :type k: int
        :rtype: None Do not return anything, modify nums in-place instead.
        """
        nums_len = len(nums)
        if k == 0 or k == nums_len:
            return nums
        m = k % nums_len
        new_nums = nums[-m:] + nums[:nums_len-m]
        print(new_nums)
        for i in range(nums_len):
            nums[i] = new_nums[i]

s = Solution()
nums = [1,2,3,4,5,6,7]
k = 3
result = s.rotate(nums, k)
print(result)

nums = [-1,-100,3,99]
k = 2
result = s.rotate(nums, k)
print(result)
